#include "Professor.h"

Professor::Professor()
{

}

Professor::Professor(const QString profName){
    this->name = profName;
    this->office = "TBA";
    this->officeHours = "TBA";
    this->phoneNumber = "TBA";
    this->email = "TBA";
}

Professor::Professor(QString name, QString office, QString officeHours, QString phoneNumber, QString email)
{
    this->name = name;
    this->office = office;
    this->officeHours = officeHours;
    this->phoneNumber = phoneNumber;
    this->email = email;
}

QString Professor::getName() const{
	return name;
}

QString Professor::getOffice() const{
	return office;
}

QString Professor::getOfficeHours() const{
	return officeHours;
}

QString Professor::getPhoneNumber() const{
	return phoneNumber;
}

QString Professor::getEmail() const{
	return email;
}

void Professor::setName(QString newName){
    this->name = newName;
}

void Professor::setOffice(QString newOffice){
    this->office = newOffice;
}

void Professor::setOfficeHours(QString newOfficeHours){
    this->officeHours = newOfficeHours;
}

void Professor::setPhoneNumber(QString newPhoneNumber){
    this->phoneNumber = newPhoneNumber;
}

void Professor::setEmail(QString newEmail){
    this->email = newEmail;
}

QDataStream &operator<<(QDataStream &out, const Professor &data)
{
    out << data.getName() << data.getOffice() << data.getOfficeHours() << data.getPhoneNumber() << data.getEmail();
   return out;
}

QDataStream &operator>>(QDataStream &in, Professor &data)
{
    QString name;
    QString office;
    QString officeHours;
    QString phoneNumber;
    QString email;
    in >> name >> office >> officeHours >> phoneNumber >> email;
    data = Professor(name, office, officeHours, phoneNumber, email);
    return in;
}

